3.1.41 \(\int e^{a+b x} \cos ^2(c+d x) \sin (c+d x) \, dx\) [41]

3.1.41.1 Optimal result
3.1.41.2 Mathematica [A] (verified)
3.1.41.3 Rubi [A] (verified)
3.1.41.4 Maple [A] (verified)
3.1.41.5 Fricas [A] (verification not implemented)
3.1.41.6 Sympy [C] (verification not implemented)
3.1.41.7 Maxima [B] (verification not implemented)
3.1.41.8 Giac [A] (verification not implemented)
3.1.41.9 Mupad [B] (verification not implemented)

3.1.41.1 Optimal result

Integrand size = 22, antiderivative size = 119 \[ \int e^{a+b x} \cos ^2(c+d x) \sin (c+d x) \, dx=-\frac {d e^{a+b x} \cos (c+d x)}{4 \left (b^2+d^2\right )}-\frac {3 d e^{a+b x} \cos (3 c+3 d x)}{4 \left (b^2+9 d^2\right )}+\frac {b e^{a+b x} \sin (c+d x)}{4 \left (b^2+d^2\right )}+\frac {b e^{a+b x} \sin (3 c+3 d x)}{4 \left (b^2+9 d^2\right )} \]

output
-1/4*d*exp(b*x+a)*cos(d*x+c)/(b^2+d^2)-3/4*d*exp(b*x+a)*cos(3*d*x+3*c)/(b^ 
2+9*d^2)+1/4*b*exp(b*x+a)*sin(d*x+c)/(b^2+d^2)+1/4*b*exp(b*x+a)*sin(3*d*x+ 
3*c)/(b^2+9*d^2)
 
3.1.41.2 Mathematica [A] (verified)

Time = 0.49 (sec) , antiderivative size = 74, normalized size of antiderivative = 0.62 \[ \int e^{a+b x} \cos ^2(c+d x) \sin (c+d x) \, dx=\frac {1}{4} e^{a+b x} \left (\frac {-d \cos (c+d x)+b \sin (c+d x)}{b^2+d^2}+\frac {-3 d \cos (3 (c+d x))+b \sin (3 (c+d x))}{b^2+9 d^2}\right ) \]

input
Integrate[E^(a + b*x)*Cos[c + d*x]^2*Sin[c + d*x],x]
 
output
(E^(a + b*x)*((-(d*Cos[c + d*x]) + b*Sin[c + d*x])/(b^2 + d^2) + (-3*d*Cos 
[3*(c + d*x)] + b*Sin[3*(c + d*x)])/(b^2 + 9*d^2)))/4
 
3.1.41.3 Rubi [A] (verified)

Time = 0.29 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {4972, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int e^{a+b x} \sin (c+d x) \cos ^2(c+d x) \, dx\)

\(\Big \downarrow \) 4972

\(\displaystyle \int \left (\frac {1}{4} e^{a+b x} \sin (c+d x)+\frac {1}{4} e^{a+b x} \sin (3 c+3 d x)\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {b e^{a+b x} \sin (c+d x)}{4 \left (b^2+d^2\right )}+\frac {b e^{a+b x} \sin (3 c+3 d x)}{4 \left (b^2+9 d^2\right )}-\frac {d e^{a+b x} \cos (c+d x)}{4 \left (b^2+d^2\right )}-\frac {3 d e^{a+b x} \cos (3 c+3 d x)}{4 \left (b^2+9 d^2\right )}\)

input
Int[E^(a + b*x)*Cos[c + d*x]^2*Sin[c + d*x],x]
 
output
-1/4*(d*E^(a + b*x)*Cos[c + d*x])/(b^2 + d^2) - (3*d*E^(a + b*x)*Cos[3*c + 
 3*d*x])/(4*(b^2 + 9*d^2)) + (b*E^(a + b*x)*Sin[c + d*x])/(4*(b^2 + d^2)) 
+ (b*E^(a + b*x)*Sin[3*c + 3*d*x])/(4*(b^2 + 9*d^2))
 

3.1.41.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 4972
Int[Cos[(f_.) + (g_.)*(x_)]^(n_.)*(F_)^((c_.)*((a_.) + (b_.)*(x_)))*Sin[(d_ 
.) + (e_.)*(x_)]^(m_.), x_Symbol] :> Int[ExpandTrigReduce[F^(c*(a + b*x)), 
Sin[d + e*x]^m*Cos[f + g*x]^n, x], x] /; FreeQ[{F, a, b, c, d, e, f, g}, x] 
 && IGtQ[m, 0] && IGtQ[n, 0]
 
3.1.41.4 Maple [A] (verified)

Time = 0.65 (sec) , antiderivative size = 99, normalized size of antiderivative = 0.83

method result size
parallelrisch \(\frac {\left (\left (-3 b^{2} d -3 d^{3}\right ) \cos \left (3 d x +3 c \right )+\left (b^{3}+b \,d^{2}\right ) \sin \left (3 d x +3 c \right )+\left (b^{2}+9 d^{2}\right ) \left (b \sin \left (d x +c \right )-d \cos \left (d x +c \right )\right )\right ) {\mathrm e}^{x b +a}}{4 b^{4}+40 b^{2} d^{2}+36 d^{4}}\) \(99\)
default \(-\frac {d \,{\mathrm e}^{x b +a} \cos \left (d x +c \right )}{4 \left (b^{2}+d^{2}\right )}-\frac {3 d \,{\mathrm e}^{x b +a} \cos \left (3 d x +3 c \right )}{4 \left (b^{2}+9 d^{2}\right )}+\frac {b \,{\mathrm e}^{x b +a} \sin \left (d x +c \right )}{4 b^{2}+4 d^{2}}+\frac {b \,{\mathrm e}^{x b +a} \sin \left (3 d x +3 c \right )}{4 b^{2}+36 d^{2}}\) \(108\)
risch \(-\frac {i {\mathrm e}^{x b +a} \left (-2 i d \left (b^{2}+9 d^{2}\right ) \cos \left (d x +c \right )+i \left (2 b^{3}+18 b \,d^{2}\right ) \sin \left (d x +c \right )-6 i d \left (b^{2}+d^{2}\right ) \cos \left (3 d x +3 c \right )-i \left (-2 b^{3}-2 b \,d^{2}\right ) \sin \left (3 d x +3 c \right )\right )}{8 \left (3 i d +b \right ) \left (i d +b \right ) \left (i d -b \right ) \left (3 i d -b \right )}\) \(131\)
norman \(\frac {\frac {d \left (b^{2}+3 d^{2}\right ) {\mathrm e}^{x b +a} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{b^{4}+10 b^{2} d^{2}+9 d^{4}}+\frac {d \left (11 b^{2}+9 d^{2}\right ) {\mathrm e}^{x b +a} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{b^{4}+10 b^{2} d^{2}+9 d^{4}}-\frac {d \left (b^{2}+3 d^{2}\right ) {\mathrm e}^{x b +a}}{b^{4}+10 b^{2} d^{2}+9 d^{4}}-\frac {4 b \left (b^{2}-d^{2}\right ) {\mathrm e}^{x b +a} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{b^{4}+10 b^{2} d^{2}+9 d^{4}}+\frac {2 b \left (b^{2}+3 d^{2}\right ) {\mathrm e}^{x b +a} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{b^{4}+10 b^{2} d^{2}+9 d^{4}}+\frac {2 b \left (b^{2}+3 d^{2}\right ) {\mathrm e}^{x b +a} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{b^{4}+10 b^{2} d^{2}+9 d^{4}}-\frac {d \left (11 b^{2}+9 d^{2}\right ) {\mathrm e}^{x b +a} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{b^{4}+10 b^{2} d^{2}+9 d^{4}}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3}}\) \(343\)

input
int(exp(b*x+a)*cos(d*x+c)^2*sin(d*x+c),x,method=_RETURNVERBOSE)
 
output
((-3*b^2*d-3*d^3)*cos(3*d*x+3*c)+(b^3+b*d^2)*sin(3*d*x+3*c)+(b^2+9*d^2)*(b 
*sin(d*x+c)-d*cos(d*x+c)))*exp(b*x+a)/(4*b^4+40*b^2*d^2+36*d^4)
 
3.1.41.5 Fricas [A] (verification not implemented)

Time = 0.26 (sec) , antiderivative size = 98, normalized size of antiderivative = 0.82 \[ \int e^{a+b x} \cos ^2(c+d x) \sin (c+d x) \, dx=\frac {{\left (2 \, b d^{2} + {\left (b^{3} + b d^{2}\right )} \cos \left (d x + c\right )^{2}\right )} e^{\left (b x + a\right )} \sin \left (d x + c\right ) + {\left (2 \, b^{2} d \cos \left (d x + c\right ) - 3 \, {\left (b^{2} d + d^{3}\right )} \cos \left (d x + c\right )^{3}\right )} e^{\left (b x + a\right )}}{b^{4} + 10 \, b^{2} d^{2} + 9 \, d^{4}} \]

input
integrate(exp(b*x+a)*cos(d*x+c)^2*sin(d*x+c),x, algorithm="fricas")
 
output
((2*b*d^2 + (b^3 + b*d^2)*cos(d*x + c)^2)*e^(b*x + a)*sin(d*x + c) + (2*b^ 
2*d*cos(d*x + c) - 3*(b^2*d + d^3)*cos(d*x + c)^3)*e^(b*x + a))/(b^4 + 10* 
b^2*d^2 + 9*d^4)
 
3.1.41.6 Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 2.49 (sec) , antiderivative size = 1040, normalized size of antiderivative = 8.74 \[ \int e^{a+b x} \cos ^2(c+d x) \sin (c+d x) \, dx=\text {Too large to display} \]

input
integrate(exp(b*x+a)*cos(d*x+c)**2*sin(d*x+c),x)
 
output
Piecewise((x*exp(a)*sin(c)*cos(c)**2, Eq(b, 0) & Eq(d, 0)), (-x*exp(a)*exp 
(-3*I*d*x)*sin(c + d*x)**3/8 + 3*I*x*exp(a)*exp(-3*I*d*x)*sin(c + d*x)**2* 
cos(c + d*x)/8 + 3*x*exp(a)*exp(-3*I*d*x)*sin(c + d*x)*cos(c + d*x)**2/8 - 
 I*x*exp(a)*exp(-3*I*d*x)*cos(c + d*x)**3/8 + I*exp(a)*exp(-3*I*d*x)*sin(c 
 + d*x)**3/(24*d) + I*exp(a)*exp(-3*I*d*x)*sin(c + d*x)*cos(c + d*x)**2/(4 
*d) + exp(a)*exp(-3*I*d*x)*cos(c + d*x)**3/(24*d), Eq(b, -3*I*d)), (x*exp( 
a)*exp(-I*d*x)*sin(c + d*x)**3/8 - I*x*exp(a)*exp(-I*d*x)*sin(c + d*x)**2* 
cos(c + d*x)/8 + x*exp(a)*exp(-I*d*x)*sin(c + d*x)*cos(c + d*x)**2/8 - I*x 
*exp(a)*exp(-I*d*x)*cos(c + d*x)**3/8 - I*exp(a)*exp(-I*d*x)*sin(c + d*x)* 
*3/(8*d) - I*exp(a)*exp(-I*d*x)*sin(c + d*x)*cos(c + d*x)**2/(4*d) - 3*exp 
(a)*exp(-I*d*x)*cos(c + d*x)**3/(8*d), Eq(b, -I*d)), (x*exp(a)*exp(I*d*x)* 
sin(c + d*x)**3/8 + I*x*exp(a)*exp(I*d*x)*sin(c + d*x)**2*cos(c + d*x)/8 + 
 x*exp(a)*exp(I*d*x)*sin(c + d*x)*cos(c + d*x)**2/8 + I*x*exp(a)*exp(I*d*x 
)*cos(c + d*x)**3/8 + I*exp(a)*exp(I*d*x)*sin(c + d*x)**3/(8*d) + I*exp(a) 
*exp(I*d*x)*sin(c + d*x)*cos(c + d*x)**2/(4*d) - 3*exp(a)*exp(I*d*x)*cos(c 
 + d*x)**3/(8*d), Eq(b, I*d)), (-x*exp(a)*exp(3*I*d*x)*sin(c + d*x)**3/8 - 
 3*I*x*exp(a)*exp(3*I*d*x)*sin(c + d*x)**2*cos(c + d*x)/8 + 3*x*exp(a)*exp 
(3*I*d*x)*sin(c + d*x)*cos(c + d*x)**2/8 + I*x*exp(a)*exp(3*I*d*x)*cos(c + 
 d*x)**3/8 - I*exp(a)*exp(3*I*d*x)*sin(c + d*x)**3/(24*d) - I*exp(a)*exp(3 
*I*d*x)*sin(c + d*x)*cos(c + d*x)**2/(4*d) + exp(a)*exp(3*I*d*x)*cos(c ...
 
3.1.41.7 Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 538 vs. \(2 (107) = 214\).

Time = 0.23 (sec) , antiderivative size = 538, normalized size of antiderivative = 4.52 \[ \int e^{a+b x} \cos ^2(c+d x) \sin (c+d x) \, dx=-\frac {{\left (3 \, b^{2} d \cos \left (3 \, c\right ) e^{a} + 3 \, d^{3} \cos \left (3 \, c\right ) e^{a} - b^{3} e^{a} \sin \left (3 \, c\right ) - b d^{2} e^{a} \sin \left (3 \, c\right )\right )} \cos \left (3 \, d x\right ) e^{\left (b x\right )} + {\left (3 \, b^{2} d \cos \left (3 \, c\right ) e^{a} + 3 \, d^{3} \cos \left (3 \, c\right ) e^{a} + b^{3} e^{a} \sin \left (3 \, c\right ) + b d^{2} e^{a} \sin \left (3 \, c\right )\right )} \cos \left (3 \, d x + 6 \, c\right ) e^{\left (b x\right )} + {\left (b^{2} d \cos \left (3 \, c\right ) e^{a} + 9 \, d^{3} \cos \left (3 \, c\right ) e^{a} + b^{3} e^{a} \sin \left (3 \, c\right ) + 9 \, b d^{2} e^{a} \sin \left (3 \, c\right )\right )} \cos \left (d x + 4 \, c\right ) e^{\left (b x\right )} + {\left (b^{2} d \cos \left (3 \, c\right ) e^{a} + 9 \, d^{3} \cos \left (3 \, c\right ) e^{a} - b^{3} e^{a} \sin \left (3 \, c\right ) - 9 \, b d^{2} e^{a} \sin \left (3 \, c\right )\right )} \cos \left (d x - 2 \, c\right ) e^{\left (b x\right )} - {\left (b^{3} \cos \left (3 \, c\right ) e^{a} + b d^{2} \cos \left (3 \, c\right ) e^{a} + 3 \, b^{2} d e^{a} \sin \left (3 \, c\right ) + 3 \, d^{3} e^{a} \sin \left (3 \, c\right )\right )} e^{\left (b x\right )} \sin \left (3 \, d x\right ) - {\left (b^{3} \cos \left (3 \, c\right ) e^{a} + b d^{2} \cos \left (3 \, c\right ) e^{a} - 3 \, b^{2} d e^{a} \sin \left (3 \, c\right ) - 3 \, d^{3} e^{a} \sin \left (3 \, c\right )\right )} e^{\left (b x\right )} \sin \left (3 \, d x + 6 \, c\right ) - {\left (b^{3} \cos \left (3 \, c\right ) e^{a} + 9 \, b d^{2} \cos \left (3 \, c\right ) e^{a} - b^{2} d e^{a} \sin \left (3 \, c\right ) - 9 \, d^{3} e^{a} \sin \left (3 \, c\right )\right )} e^{\left (b x\right )} \sin \left (d x + 4 \, c\right ) - {\left (b^{3} \cos \left (3 \, c\right ) e^{a} + 9 \, b d^{2} \cos \left (3 \, c\right ) e^{a} + b^{2} d e^{a} \sin \left (3 \, c\right ) + 9 \, d^{3} e^{a} \sin \left (3 \, c\right )\right )} e^{\left (b x\right )} \sin \left (d x - 2 \, c\right )}{8 \, {\left (b^{4} \cos \left (3 \, c\right )^{2} + b^{4} \sin \left (3 \, c\right )^{2} + 9 \, {\left (\cos \left (3 \, c\right )^{2} + \sin \left (3 \, c\right )^{2}\right )} d^{4} + 10 \, {\left (b^{2} \cos \left (3 \, c\right )^{2} + b^{2} \sin \left (3 \, c\right )^{2}\right )} d^{2}\right )}} \]

input
integrate(exp(b*x+a)*cos(d*x+c)^2*sin(d*x+c),x, algorithm="maxima")
 
output
-1/8*((3*b^2*d*cos(3*c)*e^a + 3*d^3*cos(3*c)*e^a - b^3*e^a*sin(3*c) - b*d^ 
2*e^a*sin(3*c))*cos(3*d*x)*e^(b*x) + (3*b^2*d*cos(3*c)*e^a + 3*d^3*cos(3*c 
)*e^a + b^3*e^a*sin(3*c) + b*d^2*e^a*sin(3*c))*cos(3*d*x + 6*c)*e^(b*x) + 
(b^2*d*cos(3*c)*e^a + 9*d^3*cos(3*c)*e^a + b^3*e^a*sin(3*c) + 9*b*d^2*e^a* 
sin(3*c))*cos(d*x + 4*c)*e^(b*x) + (b^2*d*cos(3*c)*e^a + 9*d^3*cos(3*c)*e^ 
a - b^3*e^a*sin(3*c) - 9*b*d^2*e^a*sin(3*c))*cos(d*x - 2*c)*e^(b*x) - (b^3 
*cos(3*c)*e^a + b*d^2*cos(3*c)*e^a + 3*b^2*d*e^a*sin(3*c) + 3*d^3*e^a*sin( 
3*c))*e^(b*x)*sin(3*d*x) - (b^3*cos(3*c)*e^a + b*d^2*cos(3*c)*e^a - 3*b^2* 
d*e^a*sin(3*c) - 3*d^3*e^a*sin(3*c))*e^(b*x)*sin(3*d*x + 6*c) - (b^3*cos(3 
*c)*e^a + 9*b*d^2*cos(3*c)*e^a - b^2*d*e^a*sin(3*c) - 9*d^3*e^a*sin(3*c))* 
e^(b*x)*sin(d*x + 4*c) - (b^3*cos(3*c)*e^a + 9*b*d^2*cos(3*c)*e^a + b^2*d* 
e^a*sin(3*c) + 9*d^3*e^a*sin(3*c))*e^(b*x)*sin(d*x - 2*c))/(b^4*cos(3*c)^2 
 + b^4*sin(3*c)^2 + 9*(cos(3*c)^2 + sin(3*c)^2)*d^4 + 10*(b^2*cos(3*c)^2 + 
 b^2*sin(3*c)^2)*d^2)
 
3.1.41.8 Giac [A] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 100, normalized size of antiderivative = 0.84 \[ \int e^{a+b x} \cos ^2(c+d x) \sin (c+d x) \, dx=-\frac {1}{4} \, {\left (\frac {3 \, d \cos \left (3 \, d x + 3 \, c\right )}{b^{2} + 9 \, d^{2}} - \frac {b \sin \left (3 \, d x + 3 \, c\right )}{b^{2} + 9 \, d^{2}}\right )} e^{\left (b x + a\right )} - \frac {1}{4} \, {\left (\frac {d \cos \left (d x + c\right )}{b^{2} + d^{2}} - \frac {b \sin \left (d x + c\right )}{b^{2} + d^{2}}\right )} e^{\left (b x + a\right )} \]

input
integrate(exp(b*x+a)*cos(d*x+c)^2*sin(d*x+c),x, algorithm="giac")
 
output
-1/4*(3*d*cos(3*d*x + 3*c)/(b^2 + 9*d^2) - b*sin(3*d*x + 3*c)/(b^2 + 9*d^2 
))*e^(b*x + a) - 1/4*(d*cos(d*x + c)/(b^2 + d^2) - b*sin(d*x + c)/(b^2 + d 
^2))*e^(b*x + a)
 
3.1.41.9 Mupad [B] (verification not implemented)

Time = 28.84 (sec) , antiderivative size = 167, normalized size of antiderivative = 1.40 \[ \int e^{a+b x} \cos ^2(c+d x) \sin (c+d x) \, dx=-\frac {{\mathrm {e}}^{a+b\,x}\,\left (\cos \left (d\,x\right )-\sin \left (d\,x\right )\,1{}\mathrm {i}\right )\,\left (\cos \left (c\right )-\sin \left (c\right )\,1{}\mathrm {i}\right )}{8\,\left (d+b\,1{}\mathrm {i}\right )}-\frac {{\mathrm {e}}^{a+b\,x}\,\left (\cos \left (d\,x\right )+\sin \left (d\,x\right )\,1{}\mathrm {i}\right )\,\left (\cos \left (c\right )+\sin \left (c\right )\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{8\,\left (b+d\,1{}\mathrm {i}\right )}-\frac {{\mathrm {e}}^{a+b\,x}\,\left (\cos \left (3\,d\,x\right )-\sin \left (3\,d\,x\right )\,1{}\mathrm {i}\right )\,\left (\cos \left (3\,c\right )-\sin \left (3\,c\right )\,1{}\mathrm {i}\right )}{8\,\left (3\,d+b\,1{}\mathrm {i}\right )}-\frac {{\mathrm {e}}^{a+b\,x}\,\left (\cos \left (3\,d\,x\right )+\sin \left (3\,d\,x\right )\,1{}\mathrm {i}\right )\,\left (\cos \left (3\,c\right )+\sin \left (3\,c\right )\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{8\,\left (b+d\,3{}\mathrm {i}\right )} \]

input
int(cos(c + d*x)^2*exp(a + b*x)*sin(c + d*x),x)
 
output
- (exp(a + b*x)*(cos(d*x) - sin(d*x)*1i)*(cos(c) - sin(c)*1i))/(8*(b*1i + 
d)) - (exp(a + b*x)*(cos(d*x) + sin(d*x)*1i)*(cos(c) + sin(c)*1i)*1i)/(8*( 
b + d*1i)) - (exp(a + b*x)*(cos(3*d*x) - sin(3*d*x)*1i)*(cos(3*c) - sin(3* 
c)*1i))/(8*(b*1i + 3*d)) - (exp(a + b*x)*(cos(3*d*x) + sin(3*d*x)*1i)*(cos 
(3*c) + sin(3*c)*1i)*1i)/(8*(b + d*3i))